import request from '/@/utils/request';

import qs from 'qs'

const addressAccountService = "GOLD-DOG-SERVICE";


export function useFundApi() {
	return {
		/**
		 * 获取系统账户类型
		 */
		systemAddressType: () => {
			return request({
				url: `${addressAccountService}/admin/system/address/listSystemAddressType`,
				method: 'get'
			});
		},


		/**
		 * 获取系统账户信息
		 * @param obj 
		 * @returns 
		 */
		querySystemAddress: (obj: any) => {
			let objStr = qs.stringify(obj);
			return request({
				url: `${addressAccountService}/admin/system/address?${objStr}`,
				method: 'get'
			});
		},


		/**
		 * 修改系统账户信息
		 * @param obj 
		 * @returns 
		 */
		updateSystemAddress: (obj: any) => {
			return request({
				url: `${addressAccountService}/admin/system/address`,
				method: 'put',
				data: obj
			});
		},



		/**
		 * 添加系统账户信息
		 * @param obj 
		 * @returns 
		 */
		addSystemAddress: (obj: any) => {
			return request({
				url: `${addressAccountService}/admin/system/address`,
				method: 'post',
				data: obj
			});
		},

		// 获取币种列表
		getcoinList: () => {
			return request({
				url: `${addressAccountService}/admin/coin/config/coinList`,
				method: 'get'
			});
		},

		// 更新币种信息
		updateCoin: (obj: any, code: any) => {
			return request({
				url: `${addressAccountService}/admin/coin/config/updateCoin`,
				method: 'post',
				data: obj,
				headers: {
					"x-header-mfa-value": code
				}
			});
		},



		// 获取用户资金列表
		accountList(obj: any) {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/account/accountList?${objStr}`;
			return request({
				url,
				method: 'get'
			});
		},


		/**
		 * 管理员更新提现额度
		 * @param obj 
		 * @returns 
		 */
		adminUpdateRechargeWithdraw(obj: any) {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/account/adminUpdateRechargeWithdraw?${objStr}`;
			return request({
				url,
				method: 'post',
			});
		},


		/**
		 * 获取交易类型
		 * @returns 
		 */
		getTradeTypes: () => {
			return request({
				url: `${addressAccountService}/address/account/listTradeType`,
				method: 'get'
			});
		},

		/**
 * 获取交易类型
 * @returns 
 */
		getPaymentRemark: () => {
			return request({
				url: `${addressAccountService}/address/account/listPaymentRemark`,
				method: 'get'
			});
		},



		/**
		 * 资金记录
		 * @param obj 
		 * @returns 
		 */
		queryAccountDetail: (obj: any) => {
			let objStr = qs.stringify(obj);
			return request({
				url: `${addressAccountService}/admin/address/account/queryAccountDetail?${objStr}`,
				method: 'get'
			});
		},

		// 历史记录
		queryAccountDetailHistory: (page: any, limit: any, obj: any) => {
			return request({
				url: `${addressAccountService}/admin/address/account/queryAccountDetailHistory?page=${page}&limit=${limit}`,
				method: 'post',
				data: obj
			});
		},



		// 审核列表
		queryAccountAuthWithDrawDetail(obj: any) {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/account/queryAccountAuthWithDrawDetail?${objStr}`;
			return request({
				method: "get",
				url: url,
			});
		},

		// 审核提现操作
		authWithdraw(obj: any, code: any) {
			let url = `${addressAccountService}/admin/address/withdraw/authWithdraw`;
			return request({
				method: "post",
				url: url,
				data: obj,
				headers: {
					"x-header-mfa-value": code
				}
			});
		},


		/**
		 * 充值或者提现
		 * @param obj 
		 * @param code 
		 * @returns 
		 */
		adminRechargeWithdraw(obj: any, code: any) {
			let url = `${addressAccountService}/admin/address/account/adminRechargeWithdraw`;
			return request({
				method: "post",
				url: url,
				data: obj,
				headers: {
					"x-header-mfa-value": code
				}
			});
		},


		/**
		 * 获取提现记录
		 * @param obj 
		 * @returns 
		 */
		adminGetWithdrawHis: (obj: any) => {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/withdraw/list?${objStr}`;
			return request({
				method: "get",
				url: url,
			});
		},



		/**
		 * 充值记录
		 * @param obj 
		 * @returns 
		 */
		adminGetRechargeHis: (obj: any) => {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/deposit/recharge/list?${objStr}`;
			return request({
				method: "get",
				url: url,
			});
		},

		/**
		 * 转账记录
		 * @param obj 
		 * @returns 
		 */
		adminGetTransferHis: (obj: any) => {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/transfer/list?${objStr}`;
			return request({
				method: "get",
				url: url,
			});
		},



		/**
		 * 充值
		 * @param obj 
		 * @param code 
		 * @returns 
		 */
		adminRecharge(obj: any, code: any) {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/account/adminRecharge?${objStr}`;
			return request({
				method: "post",
				url: url,
				headers: {
					"x-header-mfa-value": code
				}
			});
		},

		/**
		 * 提现
		 * @param obj 
		 * @param code 
		 * @returns 
		 */
		adminWithdraw(obj: any, code: any) {
			let objStr = qs.stringify(obj);
			let url = `${addressAccountService}/admin/address/account/adminWithdraw?${objStr}`;
			return request({
				method: "post",
				url: url,
				headers: {
					"x-header-mfa-value": code
				}
			});
		},




	};
}
